package com.xiantm.study.thread.workthread;

public class Request {
    private final String name;
    private final int number;


    public Request(String name, int number) {
        this.name = name;
        this.number = number;
    }

    public int getNumber() {
        return number;
    }

    public String getName() {
        return name;
    }

    public void execute(){
        System.out.println(Thread.currentThread().getName() + " executes " + toString());
//        try {
//            Thread.sleep(1000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
    }

    @Override
    public String toString() {
        return "{Request from " + name + " No." + number + "}";
    }
}
